package com.qiang.test01;

import com.qiang.test01.domain.Student;

import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;

public class Demo02 {
    public static void main(String[] args) {
        //ArrayList<Student> list = new ArrayList<>();
        Set<Student> array = new TreeSet<>();
        Student s1 = new Student("刘岩", 80, 70, 50);
        Student s2 = new Student("林青霞", 70, 90, 100);
        Student s3 = new Student("王祖贤", 70, 80, 90);
//        Student s1 = new Student();
//        s1.setName("刘岩");
//        s1.setChinese(80);
//        s1.setMath(70);
//        s1.setEnglish(90);
//
//        Student s2 = new Student();
//        s2.setName("林青霞");
//        s1.setChinese(70);
//        s1.setMath(90);
//        s1.setEnglish(100);
        array.add(s1);
        array.add(s2);
        array.add(s3);
        //System.out.println(array);
        Iterator<Student> it = array.iterator();
        while (it.hasNext()) {
            System.out.println(it.next());
        }
    }
}
